<!DOCTYPE">
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  <title>第二题不断移动的div</title>
</head>
<body>
  <div style="position: absolute;left:0px; top: 20px;width: 20px;height: 20px;background: red;"></div>
  <script>
    let div = document.querySelector('div');
    let T = setInterval(run,25)
    let i = 0;
    function run(){
      div.style.left = `${i}px`
      console.log(div.style.left)
      i++;
    }
    
  
  </script>
</body>
</html>